/*************************************************************************

Framework\System.Windows.Window.cpp

	-by Miles Chen (stainboyx@hotmail.com) 2008-12-27

*************************************************************************/

#pragma once

#include "commdef-int.h"

N System{N Windows{N Window{

	INT_PTR Show(HWND hWndParent, int nFormID, DLGPROC lpDialogFunc)
	{
		return DialogBoxParamW(GetModuleHandleW(NULL), MAKEINTRESOURCEW(nFormID), hWndParent, lpDialogFunc, NULL);
	}

	INT_PTR SetIcon(HWND hDlg, int nIconID)
	{
		HICON hIcon = LoadIconW(GetModuleHandleW(NULL), MAKEINTRESOURCEW(nIconID));
		SendMessageW(hDlg, WM_SETICON, ICON_BIG, (WPARAM)hIcon);
		SendMessageW(hDlg, WM_SETICON, ICON_SMALL, (WPARAM)hIcon);
		CloseHandle(hIcon);
		return TRUE;
	}

	int Show(LPCWSTR lpText)
	{
		return MessageBoxW(NULL, lpText, L"", MB_OK);
	}

	int Show(LPCSTR lpText)
	{
		return MessageBoxA(NULL, lpText, "", MB_OK);
	}

}}}